#include "geometry.cpp"
#include "walls.h"

// Printer's Dimensions
#define PRINTER_DIM_X (ROOMX/3)
#define PRINTER_DIM_Y (ROOMY/3)
#define PRINTER_DIM_Z (ROOMZ/4)
// Printer's Position
#define PRINTER_X -(ROOMX - PRINTER_DIM_X)
#define PRINTER_Y (PRINTER_DIM_Y / 2)
#define PRINTER_Z (PRINTER_DIM_Z / 2 - WINDOW_DIM_Z)




// Teapot Position
#define TEAPOT_X (PRINTER_X)
#define TEAPOT_Y (PRINTER_Y + PRINTER_DIM_Y*0.5)
#define TEAPOT_Z (PRINTER_Z)
// Teapot Dimension
#define TEAPOT_DIM 2
#define TEAPOT_LAMBDA (TEAPOT_DIM/5)

// Compressor's Dimensions
#define COMPRESSOR_DIM_X (PRINTER_DIM_X - PRINTER_DIM_X/3)
#define COMPRESSOR_DIM_Y (PRINTER_DIM_Y/2) //
#define COMPRESSOR_DIM_Z (WINDOW_DIM_Z - PRINTER_DIM_Z)*2
// Compressor's Position
#define COMPRESSOR_X (COMPRESSOR_DIM_X/2 + PRINTER_X - PRINTER_DIM_X/3)
#define COMPRESSOR_Y (COMPRESSOR_DIM_Y/2)
#define COMPRESSOR_Z (PRINTER_Z + PRINTER_DIM_Z/2 + COMPRESSOR_DIM_Z/2)

// Cylinder Dim	ensions
//#define CYLINDER_LENGTH (PRINTER_DIM_X-PRINTER_DIM_X/4)
#define CYLINDER_LENGTH (COMPRESSOR_DIM_X)
#define AXIS_RADIUS (PRINTER_DIM_Y/4)
// Cylinder Positions
//#define CYLINDER_X (PRINTER_X - PRINTER_DIM_X/2)
#define CYLINDER_X (COMPRESSOR_X - COMPRESSOR_DIM_X/2 - 0.4)
#define CYLINDER_Y (COMPRESSOR_DIM_Y + AXIS_RADIUS - 0.7)
#define CYLINDER_Z (COMPRESSOR_Z - COMPRESSOR_DIM_Z/2)

// Robot
#define ROBOT_LAMBDA 2
#define ROBOT_X (COMPRESSOR_X)
#define ROBOT_Y 0.5
#define ROBOT_Z (COMPRESSOR_Z + COMPRESSOR_DIM_Z/2 + ROBOT_DIM_Z/2 + ROBOT_LAMBDA)
#define ROBOT_CORRECTION 0.5
#define ROBOT_DIM_SQUARE (CYLINDER_LENGTH)
#define ROBOT_DIM_X (CYLINDER_LENGTH)
#define ROBOT_DIM_Y (COMPRESSOR_DIM_Y*3/4)
#define ROBOT_DIM_Z (CYLINDER_LENGTH)
#define ROBOT_X_CENTER (ROBOT_X)
#define ROBOT_Y_CENTER (ROBOT_Y + ROBOT_DIM_Y/2)
#define ROBOT_Z_CENTER (ROBOT_Z)
#define LIGHT_STICK_SLICES 60
#define LIGHT_STICK_LENGTH 8
#define LIGHT_STICK_RADIUS 0.4
#define LIGHT_STICK_X (ROBOT_DIM_X*1/2)
#define LIGHT_STICK_Y (ROBOT_Y - 0.1)
#define LIGHT_STICK_Z (-ROBOT_DIM_Z/2)

#define ROBOT_WHEEL_RADIUS 1
#define ROBOT_WHEEL_LENGTH 0.3
#define ROBOT_WHEEL_SLICES 60
#define ROBOT_WHEEL_X (ROBOT_DIM_X/2 - ROBOT_WHEEL_RADIUS/2)
#define ROBOT_WHEEL_Z (ROBOT_DIM_Z/2 + ROBOT_WHEEL_LENGTH*2)
#define ROBOT_WHEEL_Y (ROBOT_WHEEL_RADIUS/2 + 0.5)

#define GUILLOTINE_X COMPRESSOR_X
#define GUILLOTINE_Y COMPRESSOR_Y
#define GUILLOTINE_Z COMPRESSOR_Z
#define GUILLOTINE_ROD_DIM_X 0.5
#define GUILLOTINE_ROD_DIM_Y (COMPRESSOR_DIM_Y*3/2)
#define GUILLOTINE_ROD_DIM_Z 0.5
#define GUILLOTINE_RODS_DISTANCE (CYLINDER_LENGTH/2 )

#define GUILLOTINE_CUTTER_DIM_X (CYLINDER_LENGTH - 2*GUILLOTINE_ROD_DIM_X)
#define GUILLOTINE_CUTTER_DIM_Y (GUILLOTINE_ROD_DIM_Y/3)
#define GUILLOTINE_CUTTER_DIM_Z 1
#define GUILLOTINE_CUTTER_Y (GUILLOTINE_Y + GUILLOTINE_ROD_DIM_Y/2 + GUILLOTINE_CUTTER_DIM_Y*3/4)

#define DELTA_GUILLOTINE_Y (GUILLOTINE_CUTTER_Y-COMPRESSOR_DIM_Y)

#define PAPER_DIM_X COMPRESSOR_DIM_X
#define PAPER_DIM_Z COMPRESSOR_DIM_X
#define PAPER_DIM_INC ((float)PAPER_DIM_X/40)
#define PAPER_DIM ((float)ROBOT_DIM_X*7/8)

#define PAPER_X (CYLINDER_X + (float)COMPRESSOR_DIM_X/2)
#define PAPER_Y (COMPRESSOR_DIM_Y - 0.45)
#define PAPER_Z CYLINDER_Z


#define PAPER_GUILL_Z (GUILLOTINE_Z + PAPER_DIM)
#define PAPER_DROP_Z (ROBOT_Z - PAPER_DIM - ROBOT_LAMBDA + 0.1)

void draw_robot(GLUquadric* glQ);
void draw_wheel(GLUquadric* glQ);
void drawRod(GLUquadric* glQ);
	
void draw_print_machine(void);
void draw_print_cylinder(GLUquadric* glQ);
void draw_line_compressor(void);

void drawGuillotineRods(void);
void drawGuillotineCutter(void);

